﻿<xsl:stylesheet version="1.0"	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:str="http://exslt.org/strings"
                                extension-element-prefixes="str">

<xsl:import href="ppp/str.xsl" />

<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:include href="preferences.xsl"/>
<xsl:include href="skin-options.xsl"/>
<xsl:include href="templates.xsl" />
<xsl:include href="lowlist.xsl" />
<xsl:include href="tv-detail.xsl" />

<xsl:include href="./ppp/ppp-options.xsl" />
<xsl:include href="./ppp/ppp-templates.xsl" />
<xsl:include href="./ppp/ppp-detail-templates.xsl" />

<!-- truncate-phrase style sheet by Aaron Straup Cope http://www.aaronstraupcope.com -->
<xsl:include href="./ppp/truncate-phrase/truncate-phrase.xsl" />
<xsl:variable name="doReverseEpisodes">
	<xsl:choose>
		<xsl:when test="$reverseEpisodeOrder='true'">true</xsl:when>
		<xsl:when test="$reverseEpisodeOrder='false'">false</xsl:when>
		<xsl:otherwise>false</xsl:otherwise>
	</xsl:choose>
</xsl:variable>
<xsl:variable name="useAnimation">
	<xsl:choose>
		<xsl:when test="/details/movie/season != '-1' and $tvShow.useAnimation = 'true'">true</xsl:when>
    <xsl:when test="/details/movie/season = '-1' and $movie.useAnimation = 'true'">true</xsl:when>
		<xsl:otherwise>false</xsl:otherwise>
	</xsl:choose>
</xsl:variable>
<xsl:variable name="actorNum">
	<xsl:choose>
		<xsl:when test="/details/movie/season = '-1'">
			<xsl:value-of select="$actors.max.cnt" />
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="$actors.tv.max.cnt" />
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>
<xsl:variable name="actorNumAdj" select="$actorNum + 1" />

<xsl:variable name="iEpisodesPerPage" select="100" />
<xsl:variable name="tooManySeries">
	<xsl:choose>
		<xsl:when test="count(/details/movie/files/file/filePlot) &gt; $iEpisodesPerPage">true</xsl:when>
		<xsl:otherwise>false</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

<xsl:template match="/">
<xsl:for-each select="details/movie">
<html>
<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>!-- <xsl:value-of select="$aeonversion"/> --<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>
<head>
  <link rel="StyleSheet" type="text/css" href="exportdetails_item_popcorn.css"></link>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <title>Moviejukebox</title>

	<script type="text/javascript">
		asEpisodePlot = new Array('0');
    asEpisodeTitle = new Array('0');
    asEpisodeImage = new Array('0');
    asEpisodeTitleShort = new Array('0');
    asEpisodeNo = new Array('0');
	asEpisodeUrl = new Array('0');
	</script>
	<xsl:call-template name="get-episode-infos" />

<xsl:variable name="plot">
  <xsl:choose>
    <xsl:when test="plot = '' or plot = 'UNKNOWN'">
      <xsl:text>Plot unavailable.</xsl:text>
    </xsl:when>
    <xsl:otherwise>
	<xsl:variable name="temp-plot1">
      <xsl:call-template name="search-and-replace">
        <xsl:with-param name="input">
		  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
            <xsl:value-of select="plot"/>
		  </xsl:if>
		  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
			<xsl:value-of disable-output-escaping="yes" select='translate(plot,"{}","&lt;&gt;")' />
		  </xsl:if>
        </xsl:with-param>
        <xsl:with-param name="search-string">"</xsl:with-param>
        <xsl:with-param name="replace-string">\"</xsl:with-param>
      </xsl:call-template>
      </xsl:variable>
      <xsl:variable name="temp-plot2">
      <xsl:call-template name="search-and-replace">
        <xsl:with-param name="input">
          <xsl:value-of select="$temp-plot1"/>
        </xsl:with-param>
        <xsl:with-param name="search-string">--</xsl:with-param>
        <xsl:with-param name="replace-string">-</xsl:with-param>
      </xsl:call-template>
      </xsl:variable>
      <xsl:variable name="temp-plot">
      <xsl:choose>
        <xsl:when test="substring($temp-plot2, (string-length($temp-plot2) - string-length('-')) + 1) = '-'">
          <xsl:value-of select="substring($temp-plot2, 1, (string-length($temp-plot2) - 1))"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$temp-plot2"/>
        </xsl:otherwise>
      </xsl:choose>
      </xsl:variable>
      <xsl:value-of select="$temp-plot"/>
    </xsl:otherwise>
  </xsl:choose>
  </xsl:variable> 

  <script type="text/javascript">
  <xsl:comment>
  	var sPlotLong = "<xsl:value-of select="translate($plot,'&#xA;','')"/>"
  </xsl:comment>
  </script>
  <xsl:call-template name="get-js" />
  
	</head>
<xsl:variable name="star_rating">true</xsl:variable>
<xsl:variable name="alaska">false</xsl:variable>

	<xsl:choose>
	  <xsl:when test="season=-1">

<body bgproperties="fixed" bgcolor="#000000" onloadset="play" topmargin="0" leftmargin="0" focustext="#ffffff">
<!--<xsl:attribute name="onloadset"><xsl:value-of select="//index[@current='true']/@name"/></xsl:attribute>-->
		<xsl:if test="$coikenMod='true' or $LowList='true'">
			<xsl:attribute name="background">
				<xsl:if test="fanartFile!='UNKNOWN'"><xsl:value-of select="fanartFile"/></xsl:if>
				<xsl:if test="fanartFile='UNKNOWN'">pictures/detail/dummy_fanart.jpg</xsl:if>
			</xsl:attribute>
		</xsl:if>


<xsl:choose><xsl:when test="$LowList='false'">

<table height="720" border="0" cellspacing="0" cellpadding="0">
<xsl:if test="$extras='false'"><xsl:attribute name="width">1280</xsl:attribute></xsl:if>
<xsl:if test="$extras='true'"><xsl:attribute name="width">2560</xsl:attribute></xsl:if>
	<tr>
		<td height="720" valign="middle">
		<xsl:if test="$coikenMod='false'">
			<xsl:attribute name="class">shift-poster</xsl:attribute>
			<xsl:attribute name="align">right</xsl:attribute>
		</xsl:if>
		<xsl:if test="$coikenMod='true'">
			<xsl:attribute name="width">488</xsl:attribute>
			<xsl:attribute name="align">center</xsl:attribute>
			<xsl:attribute name="background">pictures/coikenmod/left.png</xsl:attribute>
		</xsl:if>

<table height="720" border="0" cellspacing="0" cellpadding="0"><tr><td>
<img src="pictures/1x1.png" class="coikenMod-shift-poster"/>
<xsl:if test="$posters.reflection='true' or $posters.perspective='true'">
	<img><xsl:attribute name="src"><xsl:value-of select="detailPosterFile" /></xsl:attribute></img>
</xsl:if>
<xsl:if test="$posters.reflection='false' and $posters.perspective='false'">
		    <xsl:choose>
                      <xsl:when test="$posteroverlay='true'">
		       			<table border="0" cellspacing="0" cellpadding="0"><xsl:attribute name="background"><xsl:value-of select="detailPosterFile" /></xsl:attribute><tr><td>
			<img width="{$posters.width}" height="{$posters.height}">
				<xsl:attribute name="src">pictures/detail/overlay.png</xsl:attribute>
			</img>
		</td></tr></table>
                         </xsl:when>
                       <xsl:otherwise>
                  	 			<img width="{$posters.width}" height="{$posters.height}">
				<xsl:attribute name="src"><xsl:value-of select="detailPosterFile" /></xsl:attribute>
			</img>
						</xsl:otherwise>
			</xsl:choose>
</xsl:if>
</td></tr></table>


		</td>
		<td width="*" height="720" align="left" valign="top">
		<xsl:if test="$coikenMod='false'">
			<xsl:attribute name="background">
				<xsl:value-of select="fanartFile" />
			</xsl:attribute>
		</xsl:if>

<table border="0" cellspacing="0" cellpadding="0">
<xsl:if test="$DirectedBy='' or $WrittenBy='' or $Duration='' or $Starring=''">
	<xsl:if test="$coikenMod='false' and $dim='false'"><xsl:attribute name="background">pictures/detail/info_rightpaneltop1.png</xsl:attribute></xsl:if>
	<xsl:if test="$coikenMod='false' and $dim='true'"><xsl:attribute name="background">pictures/dim/info_rightpaneltop1_dim.png</xsl:attribute></xsl:if>
	<xsl:if test="$coikenMod='true'"><xsl:attribute name="background">pictures/coikenmod/right.png</xsl:attribute></xsl:if>
</xsl:if>
<xsl:if test="$DirectedBy!='' or $WrittenBy!='' or $Duration!='' or $Starring!=''">
	<xsl:if test="$coikenMod='false' and $dim='false'"><xsl:attribute name="background">pictures/detail/info_rightpaneltop1_blank.png</xsl:attribute></xsl:if>
	<xsl:if test="$coikenMod='false' and $dim='true'"><xsl:attribute name="background">pictures/dim/info_rightpaneltop1_dim_blank.png</xsl:attribute></xsl:if>
	<xsl:if test="$coikenMod='true'"><xsl:attribute name="background">pictures/coikenmod/right_blank.png</xsl:attribute></xsl:if>
</xsl:if>
	<tr>
		<td height="720">
			<xsl:if test="$coikenMod='false'"><xsl:attribute name="class">shift-detail</xsl:attribute></xsl:if>
			<xsl:if test="$coikenMod='true'"><xsl:attribute name="width">68</xsl:attribute></xsl:if>
		</td>
		<td width="635" height="720" valign="top">
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td height="103" valign="bottom">
						<xsl:if test="$AlignRight='true' or $mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
							<xsl:attribute name="align">right</xsl:attribute>
						</xsl:if>

<xsl:attribute name="class">title</xsl:attribute>
<xsl:choose>
    <xsl:when test="string-length(title)&lt;70">
        <xsl:value-of select="title"/>
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="substring(title,1,65)"/>...
    </xsl:otherwise>
</xsl:choose>

					</td>
				</tr>
			</table>
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td width="182" height="59" align="center" valign="middle">

         <xsl:if test="certification != 'UNKNOWN' and certification != '' and certification != 'Not Rated'">
          <xsl:if test="count(genres) != 0 or (runtime != 'UNKNOWN' and runtime != '')"></xsl:if>
          <xsl:call-template name="certification" />
         </xsl:if>

					</td>
					<td width="110" align="center" valign="middle">

			<xsl:attribute name="class">year</xsl:attribute>
            <xsl:if test="season &gt; 0"> Season <xsl:value-of select="season" /></xsl:if>
            <xsl:if test="season = 0"> Specials</xsl:if>
            <xsl:if test="year != 'UNKNOWN'">
				<xsl:attribute name="class">year</xsl:attribute>
              <xsl:choose>
                <xsl:when test="year/@index != ''">
                    <xsl:value-of select="year" />
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="year" />
                </xsl:otherwise>
              </xsl:choose>
            </xsl:if>

					</td>
					<td width="19"></td>
					<td valign="middle">

            <xsl:if test="count(genres) != 0">
				<xsl:attribute name="class">gray</xsl:attribute>
              <xsl:for-each select="genres/genre[position() &lt;= 2]">
                <xsl:if test="position()!= 1"> / </xsl:if>
                <xsl:choose>
                  <xsl:when test="@index != ''">
                      <xsl:value-of select="." /> 
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="." /> 
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:for-each>
            </xsl:if>

					</td>
				</tr>
			</table>
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td width="121" height="29" valign="top">
						<xsl:attribute name="class">gray</xsl:attribute>
<xsl:if test="$DirectedBy!='' and $WrittenBy!='' and $Duration!='' and $Starring!=''"><xsl:value-of select="$DirectedBy"/></xsl:if>
					</td>
					<td valign="top">
					
            <xsl:if test="director != 'UNKNOWN'">
				<xsl:attribute name="class">plot</xsl:attribute>
              <xsl:choose>
                <xsl:when test="director/@index != ''">
                    <xsl:value-of select="director" /> 
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="director" />
                </xsl:otherwise>
              </xsl:choose>
            </xsl:if>
					
					</td>
				</tr>
				<tr>
					<td width="121" height="28" valign="top">
						<xsl:attribute name="class">gray</xsl:attribute>
<xsl:if test="$DirectedBy!='' and $WrittenBy!='' and $Duration!='' and $Starring!=''"><xsl:value-of select="$WrittenBy"/></xsl:if>
					</td>
					<td valign="top">

        <xsl:if test="count(writers/writer) != 0">
				<xsl:attribute name="class">plot</xsl:attribute>
              <xsl:for-each select="writers/writer[position() &lt;= 3]">
                <xsl:if test="position()!=1"> / </xsl:if>
                <xsl:choose>
                  <xsl:when test="@index != ''">
                      <xsl:value-of select="." /> 
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="." /> 
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:for-each>
        </xsl:if>	

					</td>
				</tr>
				<tr>
					<td width="121" height="31" valign="top">
						<xsl:attribute name="class">gray</xsl:attribute>
<xsl:if test="$DirectedBy!='' and $WrittenBy!='' and $Duration!='' and $Starring!=''"><xsl:value-of select="$Duration"/></xsl:if>
					</td>
					<td valign="top">
					
            <xsl:if test="runtime != 'UNKNOWN'">
				<xsl:attribute name="class">plot</xsl:attribute>
              <xsl:value-of select="runtime" /> 
            </xsl:if>
					
					</td>
				</tr>
				<tr>
					<td width="120" valign="top">
					<xsl:if test="$WatchBar='true'">
					<xsl:attribute name="height">115</xsl:attribute>
					</xsl:if>
					<xsl:if test="$WatchBar='false'">
					<xsl:attribute name="height">119</xsl:attribute>
					</xsl:if>
						<xsl:attribute name="class">gray</xsl:attribute>
<xsl:if test="$DirectedBy!='' and $WrittenBy!='' and $Duration!='' and $Starring!=''"><xsl:value-of select="$Starring"/></xsl:if>
					</td>
					<td valign="top">
						<xsl:if test="$AlignRight='true' or $mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
							<xsl:attribute name="align">right</xsl:attribute>
						</xsl:if>
					
        <xsl:if test="count(cast/actor) != 0">
				<xsl:attribute name="class">plot</xsl:attribute>
              <xsl:for-each select="cast/actor[position() &lt;= $actors.max]">
                <xsl:if test="position()!=1"> / </xsl:if>
                <xsl:choose>
                  <xsl:when test="@index != ''">
                      <xsl:value-of select="." /> 
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="." /> 
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:for-each>
        </xsl:if>
					
					</td>
				</tr>

<!-- trailer start -->
<xsl:if test="$WatchBar='true'">
<tr><td colspan="2">

<xsl:if test="count(extras) != 0">
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="176" height="40">

				<xsl:call-template name="trailer"/>

				</td><td width="459" valign="middle" align="right">
				<xsl:attribute name="class">multi</xsl:attribute>
				
                       <xsl:choose>
                        <xsl:when test="count(files/file) = 1"></xsl:when>
                        <xsl:otherwise>
                         <xsl:value-of select="count(files/file)" /><img src="pictures/detail/multi.png"/>
                        </xsl:otherwise>
                       </xsl:choose>
				
				</td></tr></table>
</xsl:if>

<xsl:if test="count(extras) = 0">
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="176" height="40">
				<img src="pictures/detail/watch.png"></img>
			</td>
			<td width="459" valign="middle" align="right">
				<xsl:attribute name="class">multi</xsl:attribute>
				
                       <xsl:choose>
                        <xsl:when test="count(files/file) = 1"></xsl:when>
                        <xsl:otherwise>
                         <xsl:value-of select="count(files/file)" /><img src="pictures/detail/multi.png"/>
                        </xsl:otherwise>
                       </xsl:choose>
					   
			</td>
		</tr>
	</table>
	  <a TVID="RIGHT">
        <xsl:attribute name="href"><xsl:choose><xsl:when
          test="contains(next,'UNKNOWN')"><xsl:value-of select="first" />.html</xsl:when><xsl:otherwise><xsl:value-of
          select="next" />.html</xsl:otherwise></xsl:choose></xsl:attribute>
      </a>
	  <xsl:if test="$extras='false'">
      <a TVID="LEFT">
        <xsl:attribute name="href"><xsl:choose><xsl:when
          test="contains(previous,'UNKNOWN')"><xsl:value-of select="last" />.html</xsl:when><xsl:otherwise><xsl:value-of
          select="previous" />.html</xsl:otherwise></xsl:choose></xsl:attribute>
      </a>
	  </xsl:if>
</xsl:if>

</td></tr>

</xsl:if>

<!--  trailer end  -->

				<tr>
					<td width="635" colspan="2" valign="top">
						<xsl:if test="$AlignRight='true' or $mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
							<xsl:attribute name="align">right</xsl:attribute>
						</xsl:if>
					<xsl:if test="$WatchBar='true'">
					<xsl:attribute name="height">224</xsl:attribute>
					</xsl:if>
					<xsl:if test="$WatchBar='false'">
					<xsl:attribute name="height">260</xsl:attribute>
					</xsl:if>

<xsl:if test="plot != 'UNKNOWN'">
	<xsl:attribute name="class">plot</xsl:attribute>
	<xsl:if test="$WatchBar='true'">
		<xsl:call-template name="PreserveLineBreaksShort">
			<xsl:with-param name="text" select="plot"/>
		</xsl:call-template>
	</xsl:if>
	<xsl:if test="$WatchBar='false'">
		<xsl:call-template name="PreserveLineBreaksLong">
			<xsl:with-param name="text" select="plot"/>
		</xsl:call-template>
	</xsl:if>
</xsl:if>

					</td>
				</tr>
			</table>
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td width="105" height="45" align="center">
						<xsl:choose>
							<xsl:when test="$videosource='true'">
								<xsl:call-template name="videoSource" />
							</xsl:when>
							<xsl:when test="$videosource='false'">
								<xsl:call-template name="videoCodec" />
							</xsl:when>
							<xsl:when test="$videosource='primary'">
								<xsl:if test="videoSource!='UNKNOWN'">
									<xsl:call-template name="videoSource" />
								</xsl:if>
								<xsl:if test="videoSource='UNKNOWN'">
									<xsl:call-template name="videoCodec" />
								</xsl:if>
							</xsl:when>
							<xsl:when test="$videosource='secondary'">
								<xsl:if test="videoCodec!='UNKNOWN'">
									<xsl:call-template name="videoCodec" />
								</xsl:if>
								<xsl:if test="videoCodec='UNKNOWN'">
									<xsl:call-template name="videoSource" />
								</xsl:if>
							</xsl:when>
						</xsl:choose>
					</td>
					<td width="150" align="center"><xsl:attribute name="class">plot</xsl:attribute><xsl:call-template name="audioCodec" />
					</td>
					<td width="60" align="center"><xsl:call-template name="subtitles" />
					</td>
					<td width="90" align="center"><xsl:attribute name="class">plot</xsl:attribute>
						<xsl:choose>
							<xsl:when test="$VideoOutputOrFPS='output'">
								<xsl:call-template name="videoOutput" />
							</xsl:when>
							<xsl:when test="$VideoOutputOrFPS='fps'">
								<xsl:call-template name="framerate" />
							</xsl:when>
						</xsl:choose>
					</td>
					<td width="10" height="45"></td>
					<td width="131" align="left">
			<xsl:if test="rating != -1">
              <xsl:if test="$star_rating = 'true'">
                <img><xsl:attribute name="src">pictures/detail/rating_<xsl:value-of select="round(rating div 10)*10" />.png</xsl:attribute></img>
              </xsl:if>
            </xsl:if>
					</td>
					<td align="left" width="89"><xsl:attribute name="class">rating</xsl:attribute>

              <xsl:if test="$number-rating =	'true'">&#160;<xsl:value-of select="rating div 10" />/10</xsl:if>
					
					</td>
				</tr>
			</table>
			<xsl:if test="$ShowLibrary='true'">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="25">
							<xsl:attribute name="class">library</xsl:attribute>
								<xsl:value-of select="translate($Library,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>: 
						</td>
						<td>
							<xsl:attribute name="class">white</xsl:attribute>
								<xsl:if test="libraryDescription!='UNKNOWN'"><xsl:value-of select="libraryDescription"/></xsl:if>
						</td>
					</tr>
				</table>
			</xsl:if>
		</td>
		<td height="720" align="left" valign="middle">
		<xsl:if test="$coikenMod='false'"><xsl:attribute name="width">95</xsl:attribute></xsl:if>
		<xsl:if test="$coikenMod='true'"><xsl:attribute name="width">93</xsl:attribute></xsl:if>

<xsl:call-template name="playfile"/>

		</td>
	</tr>
</table>
		</td>



<xsl:choose><xsl:when test="$extras='true'">
<td width="1280" align="right" valign="top">
<xsl:call-template name="companion"/>
</td>
</xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose>



	</tr>
</table>


</xsl:when>

<xsl:when test="$LowList='true'"><xsl:call-template name="lowlist"/></xsl:when>

</xsl:choose>

</body>

    </xsl:when>
    <xsl:otherwise>

<xsl:call-template name="tv-detail"/>

	  </xsl:otherwise>
  </xsl:choose>


  
  
  
  
  
<xsl:if test="$ForComputer='true'">
<div id="computer">
<table border="0" cellspacing="0" cellpadding="0" background="pictures/wall/filterbg1.png"><tr>
<td width="40">
	<a>
	<xsl:attribute name="href">
		<xsl:choose>
		<xsl:when test="contains(previous,'UNKNOWN')"><xsl:value-of select="last" />.html</xsl:when>
		<xsl:otherwise><xsl:value-of select="previous" />.html</xsl:otherwise>
		</xsl:choose>
	</xsl:attribute>
	<img src="pictures/wall/leftarrowon.png" height="20"/>
	</a>
</td>
<xsl:if test="season=-1">
<td class="plot">
	<xsl:if test="count(extras) != 0">
		<xsl:attribute name="width">305</xsl:attribute>
	</xsl:if>
	<xsl:if test="count(extras) = 0">
		<xsl:attribute name="width">455</xsl:attribute>
	</xsl:if>
	<xsl:choose>
		<xsl:when test="count(files/file) = 1"><!-- multipart=1 -->
			<a><xsl:attribute name="href"><xsl:value-of select="//files/file/fileURL" /></xsl:attribute><xsl:value-of select="$Watch"/></a>
		</xsl:when>
		<xsl:otherwise><!-- multipart=2+ -->
			<xsl:if test="$PlaylistExtension != ''">
				<a>
					<xsl:attribute name="href">
						<xsl:value-of select="baseFilename"/>.<xsl:value-of select="$PlaylistExtension"/>
					</xsl:attribute><xsl:value-of select="$PlayAllText"/>
				</a>&#160;|&#160;
			</xsl:if>
		<xsl:value-of select="$Part"/>:
			<xsl:for-each select="files/file">
				<xsl:sort select="@firstPart" data-type="number" order="ascending"/>
					<a><xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>&#160;&#160;<xsl:value-of select="@firstPart"/></a>
			</xsl:for-each>
		</xsl:otherwise>
	</xsl:choose>
</td>
</xsl:if>
<xsl:if test="season!=-1">
<td class="plot" width="455"><!-- width=455 assumes no extras -->
	<xsl:if test="$PlaylistExtension != ''">
		<a class="TvLink">
			<xsl:attribute name="href">
				<xsl:value-of select="baseFilename"/>.<xsl:value-of select="$PlaylistExtension"/>
			</xsl:attribute><xsl:value-of select="$PlayAllText"/>
		</a>
	</xsl:if>
</td>
</xsl:if>
<xsl:if test="count(extras) != 0"><!-- check trailer -->
<td class="plot" width="150" align="center">
	<xsl:for-each select="extras/extra[position() &lt;= 1]">
		<a><xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute><xsl:value-of select="$Trailer"/></a>
	</xsl:for-each>
</td>
</xsl:if><!-- /check trailer -->
<td class="plot" width="100" align="center">
	<a><xsl:attribute name="href">../index.htm</xsl:attribute>HOME</a>
</td>
<td width="40" align="right">
	<a>
	<xsl:attribute name="href">
		<xsl:choose>
			<xsl:when test="contains(next,'UNKNOWN')"><xsl:value-of select="first" />.html</xsl:when>
			<xsl:otherwise><xsl:value-of select="next" />.html</xsl:otherwise>
		</xsl:choose>
	</xsl:attribute>
	<img src="pictures/wall/rightarrowon.png" height="20"/>
	</a>
</td>
</tr></table>
</div>
</xsl:if>
  
  
  
  
  
  
  
  
  
      <!-- Navigation using remote keys: Home, PageUP/PageDown (Previous/Next) -->
	  <a>
        <xsl:attribute name="TVID">HOME</xsl:attribute>
        <xsl:attribute name="href"><xsl:value-of select="$homePage" /></xsl:attribute>
      </a>
	  <a>
        <xsl:attribute name="TVID">TAB</xsl:attribute>
        <xsl:attribute name="href"><xsl:value-of select="$homePage" /></xsl:attribute>
      </a>
<xsl:if test="$ParentalControl = 'false'">
      <a TVID="PGDN" ONFOCUSLOAD="">
	    <xsl:attribute name="name">pgdn</xsl:attribute>
        <xsl:attribute name="href"><xsl:choose><xsl:when
          test="contains(next,'UNKNOWN')"><xsl:value-of select="first" />.html</xsl:when><xsl:otherwise><xsl:value-of
          select="next" />.html</xsl:otherwise></xsl:choose></xsl:attribute>
      </a>
      <a TVID="PGUP" ONFOCUSLOAD="">
	    <xsl:attribute name="name">pgup</xsl:attribute>
        <xsl:attribute name="href"><xsl:choose><xsl:when
          test="contains(previous,'UNKNOWN')"><xsl:value-of select="last" />.html</xsl:when><xsl:otherwise><xsl:value-of
          select="previous" />.html</xsl:otherwise></xsl:choose></xsl:attribute>
      </a>
</xsl:if>
<xsl:if test="$ParentalControl = 'true'">
      <a TVID="PGDN" ONFOCUSLOAD="">
	    <xsl:attribute name="name">pgdn</xsl:attribute>
        <xsl:attribute name="href">javascript:history.back();</xsl:attribute>
      </a>
      <a TVID="PGUP" ONFOCUSLOAD="">
	    <xsl:attribute name="name">pgup</xsl:attribute>
        <xsl:attribute name="href">javascript:history.back();</xsl:attribute>
      </a>
</xsl:if>
	  
<xsl:if test="$RedURL != ''"><a><xsl:attribute name="TVID">RED</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$RedURL" /></xsl:attribute></a></xsl:if>
<xsl:if test="$GreenURL != ''"><a><xsl:attribute name="TVID">GREEN</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$GreenURL" /></xsl:attribute></a></xsl:if>
<xsl:if test="$YellowURL != ''"><a><xsl:attribute name="TVID">YELLOW</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$YellowURL" /></xsl:attribute></a></xsl:if>
<xsl:if test="$BlueURL != ''"><a><xsl:attribute name="TVID">BLUE</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$BlueURL" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Angle != ''"><a><xsl:attribute name="TVID">COPY</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Angle" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Stop != ''"><a><xsl:attribute name="TVID">ESC</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Stop" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Repeat != ''"><a><xsl:attribute name="TVID">REPEAT</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Repeat" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Source != ''"><a><xsl:attribute name="TVID">USR</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Source" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Setup != ''"><a><xsl:attribute name="TVID">SETUP</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Setup" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Delete != ''"><a><xsl:attribute name="TVID">CLEAR</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Delete" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Title != ''"><a><xsl:attribute name="TVID">URL</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Title" /></xsl:attribute></a></xsl:if>
<xsl:if test="$Info != ''"><a><xsl:attribute name="TVID">INFO</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$Info" /></xsl:attribute></a></xsl:if>
  
  

  </html>
</xsl:for-each>
</xsl:template>

<xsl:template name="zcd">
  <xsl:param name="url"/>
  <xsl:param name="container"/>

  <xsl:if test="$container = 'ISO' or (substring($url, (string-length($url) - string-length('.ISO')) + 1) = '.ISO') or (substring($url, (string-length($url) - string-length('.iso')) + 1) = '.iso')">
    <xsl:attribute name="zcd">2</xsl:attribute>
  </xsl:if>

  <xsl:if test="$container = 'IMG' or (substring($url, (string-length($url) - string-length('.IMG')) + 1) = '.IMG') or (substring($url, (string-length($url) - string-length('.img')) + 1) = '.img')">
    <xsl:attribute name="zcd">2</xsl:attribute>
  </xsl:if>

  <xsl:if test="substring($url, (string-length($url) - string-length('VIDEO_TS')) + 1) = 'VIDEO_TS'">
    <xsl:attribute name="zcd">2</xsl:attribute>
  </xsl:if>

  <xsl:if test="substring($url, (string-length($url) - string-length('/')) + 1) = '/'">
    <xsl:attribute name="zcd">2</xsl:attribute>
  </xsl:if>
</xsl:template>

<xsl:template name="PreserveLineBreaksShort"><!-- WatchBar ON -->
    <xsl:param name="text"/>
    <xsl:choose>
        <xsl:when test="contains($text,'&#xA;')">
            <xsl:value-of select="substring-before($text,'&#xA;')"/>
            <br/>
            <xsl:call-template name="PreserveLineBreaksShort">
                <xsl:with-param name="text">
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="substring-after($text,'&#xA;')"/>
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate(substring-after($text,"&#xA;"),"{}","&lt;&gt;")' />
				  </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:when>
		<xsl:when test="string-length($text)&lt;$PlotLength">
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="$text"/><!-- old -->
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate($text,"{}","&lt;&gt;")'/>
				  </xsl:if>
		</xsl:when>
        <xsl:otherwise>
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="substring($text,1,($PlotLength)-4)"/>...<!-- old -->
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate(substring($text,1,($PlotLength)-4),"{}","&lt;&gt;")'/>...
				  </xsl:if>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="PreserveLineBreaksLong"><!-- WatchBar OFF -->
    <xsl:param name="text"/>
    <xsl:choose>
        <xsl:when test="contains($text,'&#xA;')">
            <xsl:value-of select="substring-before($text,'&#xA;')"/>
            <br/>
            <xsl:call-template name="PreserveLineBreaksLong">
                <xsl:with-param name="text">
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="substring-after($text,'&#xA;')"/>
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate(substring-after($text,"&#xA;"),"{}","&lt;&gt;")' />
				  </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:when>
		<xsl:when test="string-length($text)&lt;($PlotLength)+150">
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="$text"/><!-- old -->
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate($text,"{}","&lt;&gt;")'/>
				  </xsl:if>
		</xsl:when>
        <xsl:otherwise>
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="substring($text,1,($PlotLength)+146)"/>...<!-- old -->
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate(substring($text,1,($PlotLength)+146),"{}","&lt;&gt;")'/>...
				  </xsl:if>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="PreserveLineBreaksLowList"><!-- WatchBar ON -->
    <xsl:param name="text"/>
    <xsl:choose>
        <xsl:when test="contains($text,'&#xA;')">
            <xsl:value-of select="substring-before($text,'&#xA;')"/>
            <br/>
            <xsl:call-template name="PreserveLineBreaksShort">
                <xsl:with-param name="text">
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="substring-after($text,'&#xA;')"/>
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate(substring-after($text,"&#xA;"),"{}","&lt;&gt;")' />
				  </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:when>
		<xsl:when test="string-length($text)&lt;($PlotLength)-450">
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="$text"/><!-- old -->
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate($text,"{}","&lt;&gt;")'/>
				  </xsl:if>
		</xsl:when>
        <xsl:otherwise>
				  <xsl:if test="$mjb.internet.plugin!='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of select="substring($text,1,($PlotLength)-454)"/>...<!-- old -->
				  </xsl:if>
				  <xsl:if test="$mjb.internet.plugin='com.moviejukebox.plugin.SratimPlugin'">
					<xsl:value-of disable-output-escaping="yes" select='translate(substring($text,1,($PlotLength)-454),"{}","&lt;&gt;")'/>...
				  </xsl:if>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="trailer">
			   <xsl:for-each select="extras/extra[position() &lt;= 1]">
					<a>
						<xsl:attribute name="onkeydownset">pgdn</xsl:attribute>
						<xsl:attribute name="onkeyupset">pgup</xsl:attribute>
						<xsl:attribute name="name">trailer</xsl:attribute>
						<xsl:attribute name="onkeyrightset">play</xsl:attribute>
						<xsl:attribute name="onkeyleftset">play</xsl:attribute>
						<xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
							<xsl:call-template name="zcd">
								<xsl:with-param name="url" select="."/>
							</xsl:call-template>
								<xsl:if test="//movie/prebuf != '-1'">
									<xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
								</xsl:if>
								<xsl:attribute name="vod"/>

<xsl:if test="translate(substring(//movie/extras/extra/@title,1,5),'BONUS','bonus')='bonus'">
									<xsl:choose> 
										<xsl:when test="count(//movie/extras/extra) = 1 ">
											<xsl:if test="$LowList='false'">
												<img src="pictures/detail/bonusoff.png" onfocussrc="pictures/detail/bonuson.png" align="top"/>
											</xsl:if>
											<xsl:if test="$LowList='true'">
												<img src="pictures/lowlist/bonusoff.png" onfocussrc="pictures/lowlist/bonuson.png" align="top"/>
											</xsl:if>
										</xsl:when>
										<xsl:otherwise>
											<xsl:if test="position() = 1">
												<xsl:if test="$LowList='false'">
													<img src="pictures/detail/bonusoff.png" onfocussrc="pictures/detail/bonuson.png" align="top"/>
												</xsl:if>
												<xsl:if test="$LowList='true'">
													<img src="pictures/lowlist/bonusoff.png" onfocussrc="pictures/lowlist/bonuson.png" align="top"/>
												</xsl:if>
											</xsl:if>
										</xsl:otherwise>
									</xsl:choose>
</xsl:if>
<xsl:if test="translate(substring(//movie/extras/extra/@title,1,5),'EXTRA','extra')='extra' or substring(//movie/extras/extra/@title,1,7)='UNKNOWN'">
									<xsl:choose> 
										<xsl:when test="count(//movie/extras/extra) = 1 ">
											<xsl:if test="$LowList='false'">
												<img src="pictures/detail/extraoff.png" onfocussrc="pictures/detail/extraon.png" align="top"/>
											</xsl:if>
											<xsl:if test="$LowList='true'">
												<img src="pictures/lowlist/extraoff.png" onfocussrc="pictures/lowlist/extraon.png" align="top"/>
											</xsl:if>
										</xsl:when>
										<xsl:otherwise>
											<xsl:if test="position() = 1">
												<xsl:if test="$LowList='false'">
													<img src="pictures/detail/extraoff.png" onfocussrc="pictures/detail/extraon.png" align="top"/>
												</xsl:if>
												<xsl:if test="$LowList='true'">
													<img src="pictures/lowlist/extraoff.png" onfocussrc="pictures/lowlist/extraon.png" align="top"/>
												</xsl:if>
											</xsl:if>
										</xsl:otherwise>
									</xsl:choose>
</xsl:if>
<xsl:if test="translate(substring(//movie/extras/extra/@title,1,7),'TRAILER','trailer')='trailer'">
									<xsl:choose> 
										<xsl:when test="count(//movie/extras/extra) = 1 ">
											<xsl:if test="$LowList='false'">
												<img src="pictures/detail/traileroff.png" onfocussrc="pictures/detail/traileron.png" align="top"/>
											</xsl:if>
											<xsl:if test="$LowList='true'">
												<img src="pictures/lowlist/traileroff.png" onfocussrc="pictures/lowlist/traileron.png" align="top"/>
											</xsl:if>
										</xsl:when>
										<xsl:otherwise>
											<xsl:if test="position() = 1">
												<xsl:if test="$LowList='false'">
													<img src="pictures/detail/traileroff.png" onfocussrc="pictures/detail/traileron.png" align="top"/>
												</xsl:if>
												<xsl:if test="$LowList='true'">
													<img src="pictures/lowlist/traileroff.png" onfocussrc="pictures/lowlist/traileron.png" align="top"/>
												</xsl:if>
											</xsl:if>
										</xsl:otherwise>
									</xsl:choose>
</xsl:if>

						</a>
				</xsl:for-each>
</xsl:template>

<xsl:template name="companion">
	<table border="0" cellspacing="0" cellpadding="0">
	<tr><td align="right" width="500" bgcolor="white-alpha3">
<a>
<xsl:attribute name="class">extras</xsl:attribute>
<xsl:attribute name="name">refresh</xsl:attribute>
<xsl:attribute name="onkeyleftset">last</xsl:attribute>
<xsl:attribute name="onkeyupset">last</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="details" /></xsl:attribute>
[<xsl:value-of select="$BackToDetails"/>]
</a>
	</td></tr>

                <xsl:if test="year/@index != ''"><tr><td align="right" bgcolor="white-alpha3"><!--when-->
                  <a>
					<xsl:attribute name="class">extras</xsl:attribute>
                    <xsl:attribute name="href"><xsl:value-of select="year/@index" />.html</xsl:attribute>
					<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
					<xsl:attribute name="name">extras</xsl:attribute>
                    <xsl:value-of select="year" />
                  </a>
                </td></tr></xsl:if>
<tr><td align="right" bgcolor="white-alpha3">
            <xsl:if test="count(genres) != 0">
              <xsl:for-each select="genres/genre[position() &lt;= $genres.max]">
			  <table border="0" cellpadding="0" cellspacing="0"><tr><td>
                <xsl:if test="position()!= 1">  </xsl:if>
                <xsl:choose>
                  <xsl:when test="@index != ''">
                    <a>
					  <xsl:attribute name="class">extras</xsl:attribute>
                      <xsl:attribute name="href"><xsl:value-of select="@index" />.html</xsl:attribute>
					  <xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
					  <xsl:attribute name="name">extras</xsl:attribute>
                      <xsl:value-of select="." /> 
                    </a>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="." /> 
                  </xsl:otherwise>
                </xsl:choose>
				</td></tr></table>
              </xsl:for-each>
            </xsl:if>
</td></tr>
                <xsl:if test="director/@index != ''"><tr><td align="right" bgcolor="white-alpha3"><!--when-->
                  <a>
				    <xsl:attribute name="class">extras</xsl:attribute>
                    <xsl:attribute name="href"><xsl:value-of select="director/@index" />.html</xsl:attribute>
					<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
					<xsl:attribute name="name">extras</xsl:attribute>
                    <xsl:value-of select="director" /> 
                  </a>
                </td></tr></xsl:if>

                <xsl:if test="country != 'UNKNOWN' and country/@index != ''"><tr><td align="right" bgcolor="white-alpha3"><!--when-->
                  <a>
				    <xsl:attribute name="class">extras</xsl:attribute>
                    <xsl:attribute name="href"><xsl:value-of select="country/@index" />.html</xsl:attribute>
					<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
					<xsl:attribute name="name">extras</xsl:attribute>
                    <xsl:value-of select="country" />
                  </a>
                </td></tr></xsl:if>
<tr><td align="right" bgcolor="white-alpha3">
			<xsl:if test="count(cast/actor) != 0">
              <xsl:for-each select="cast/actor[position() &lt;= $actors.max]">
			  <table border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="white-alpha3">
                <xsl:if test="position()!=1">  </xsl:if>
                <xsl:choose>
                  <xsl:when test="@index != ''">
                    <a>
					  <xsl:attribute name="class">extras</xsl:attribute>
                      <xsl:attribute name="href"><xsl:value-of select="@index" />.html</xsl:attribute>
					  <xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
					  <xsl:attribute name="name">extras</xsl:attribute>
                      <xsl:value-of select="." /> 
                    </a>
                  </xsl:when>
                  <xsl:otherwise>
<!--                    <xsl:value-of select="." /> -->
                  </xsl:otherwise>
                </xsl:choose>
				</td></tr></table>
              </xsl:for-each>
			</xsl:if>
</td></tr>
<tr><td bgcolor="white-alpha3">.</td></tr>
		<xsl:if test="count(files/file) != 1">
			   <xsl:for-each select="files/file"><!--[position() &lt;= 1]-->
					<tr><td align="right" bgcolor="white-alpha3">
					<a>
						<xsl:attribute name="class">extras</xsl:attribute>
						<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
						<xsl:attribute name="name">extras</xsl:attribute>
						<xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
							<xsl:call-template name="zcd">
								<xsl:with-param name="url" select="fileURL"/>
								<xsl:with-param name="container" select="//movie/container"/>
							</xsl:call-template>
								<xsl:if test="//movie/prebuf != '-1'"><xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute></xsl:if>
								<xsl:attribute name="vod"/>
							<xsl:value-of select="$Part"/><xsl:text> </xsl:text><xsl:value-of select="@firstPart" /><xsl:text> - </xsl:text><xsl:value-of select="@title" />
						</a>
						</td></tr>
				</xsl:for-each>
		</xsl:if>
<tr><td bgcolor="white-alpha3">.</td></tr>

		<xsl:if test="count(extras) != 0">
			   <xsl:for-each select="extras/extra"><!--[position() &lt;= 1]-->
					<tr><td align="right" bgcolor="white-alpha3">
					<a>
						<xsl:attribute name="class">extras</xsl:attribute>
						<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
						<xsl:attribute name="name">extras</xsl:attribute>
						<xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
							<xsl:call-template name="zcd">
								<xsl:with-param name="url" select="."/>
							</xsl:call-template>
								<xsl:if test="//movie/prebuf != '-1'">
									<xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
								</xsl:if>
								<xsl:attribute name="vod"/>
							<xsl:value-of select="@title" />
						</a>
						</td></tr>
				</xsl:for-each>
		</xsl:if>
	<tr><td align="right" width="500" bgcolor="white-alpha3">
<a>
<xsl:attribute name="class">extras</xsl:attribute>
<xsl:attribute name="name">last</xsl:attribute>
<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
<xsl:attribute name="onkeydownset">refresh</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="details" /></xsl:attribute>
[<xsl:value-of select="$BackToDetails"/>]
</a>
	</td></tr>
				</table>
</xsl:template>

<xsl:template name="playfile">
        <xsl:choose>
          <xsl:when test="count(files/file) = 1">
            <xsl:for-each select="files/file">
<!--                <xsl:if test="//movie/season != -1">
                  <td align="right" class="normal">
                    <xsl:value-of select="@firstPart"/>
                    <xsl:if test="@firstPart!=@lastPart">-<xsl:value-of select="@lastPart"/></xsl:if>.
                  </td>
                </xsl:if>-->
                  <a class="link"><xsl:attribute name="href">
				  
<xsl:choose>
<xsl:when test="//movie/container = 'RAR' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.RAR' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.rar'">
<xsl:value-of select="concat(//files/file/fileURL,'?playall=1')" />
</xsl:when>
<xsl:otherwise>
					<xsl:value-of select="fileURL" />
</xsl:otherwise></xsl:choose>

</xsl:attribute>
							<xsl:attribute name="onkeydownset">pgdn</xsl:attribute>
							<xsl:attribute name="onkeyupset">pgup</xsl:attribute>
							
							<xsl:choose><xsl:when test="$WatchBar='true'">
							<xsl:attribute name="onkeyrightset">trailer</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:attribute name="onkeyrightset">pgdn</xsl:attribute>
							</xsl:otherwise></xsl:choose>
							<xsl:choose><xsl:when test="$extras='true'">
							<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:if test="$WatchBar='true'">
							<xsl:attribute name="onkeyleftset">trailer</xsl:attribute>
							</xsl:if>
							<xsl:if test="$WatchBar='false'">
							<xsl:attribute name="onkeyleftset">pgup</xsl:attribute>
							</xsl:if>
							</xsl:otherwise></xsl:choose>
							
                    <xsl:attribute name="TVID">Play</xsl:attribute>
                    <xsl:attribute name="name">play</xsl:attribute>

                    <xsl:call-template name="zcd">
                      <xsl:with-param name="url" select="fileURL"/>
                      <xsl:with-param name="container" select="//movie/container"/>
                    </xsl:call-template>

<xsl:choose>
<xsl:when test="//movie/container = 'RAR' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.RAR' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.rar'">
<xsl:attribute name="vod">playlist</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="vod"/>
</xsl:otherwise></xsl:choose>

                    <xsl:if test="//movie/prebuf != -1">
                      <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
                    </xsl:if>

                    <xsl:choose>
                      <xsl:when test="//movie/season = -1">
                        <img src="pictures/detail/1x688.png" onfocussrc="pictures/detail/1x688.png"/>
                      </xsl:when>
<!--                      <xsl:otherwise>
                        <img src="pictures/play_small.png" onfocussrc="pictures/play_selected_small.png" align="top"/>
                        <xsl:choose>
                          <xsl:when test="@title='UNKNOWN'">
                            <xsl:choose>
                              <xsl:when test="@firstPart!=@lastPart">
                                Episodes <xsl:value-of select="@firstPart"/> - <xsl:value-of select="@lastPart"/>
                              </xsl:when>
                              <xsl:otherwise>
                                Episode <xsl:value-of select="@firstPart"/>
                              </xsl:otherwise>
                            </xsl:choose>
                          </xsl:when>
                          <xsl:otherwise><xsl:value-of select="@title"/></xsl:otherwise>
                        </xsl:choose>
                      </xsl:otherwise>-->
                    </xsl:choose>
                  </a>
            </xsl:for-each>
          </xsl:when>

<!-- *.part01.rar, *.part02.rar -->
<xsl:when test="substring(//files/file/fileURL,string-length(//files/file/fileURL)-9,10) = 'part01.rar' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-9,10) = 'PART01.RAR' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-10,11) = 'part001.rar' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-10,11) = 'PART001.RAR'">
	<a class="link">
		<xsl:attribute name="href">
			<xsl:value-of select="concat(//files/file/fileURL,'?playall=1')" />
		</xsl:attribute>
							<xsl:attribute name="onkeydownset">pgdn</xsl:attribute>
							<xsl:attribute name="onkeyupset">pgup</xsl:attribute>
							
							<xsl:choose>
								<xsl:when test="$WatchBar='true'">
										<xsl:attribute name="onkeyrightset">trailer</xsl:attribute>
								</xsl:when>
								<xsl:otherwise>
									<xsl:attribute name="onkeyrightset">pgdn</xsl:attribute>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:choose><xsl:when test="$extras='true'">
							<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:if test="$WatchBar='true'">
							<xsl:attribute name="onkeyleftset">trailer</xsl:attribute>
							</xsl:if>
							<xsl:if test="$WatchBar='false'">
							<xsl:attribute name="onkeyleftset">pgup</xsl:attribute>
							</xsl:if>
							</xsl:otherwise></xsl:choose>
							
                    <xsl:attribute name="TVID">Play</xsl:attribute>
                    <xsl:attribute name="name">play</xsl:attribute>

					<xsl:attribute name="vod">playlist</xsl:attribute>

                    <xsl:if test="//movie/prebuf != -1">
                      <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
                    </xsl:if>
					<img src="pictures/detail/1x688.png" onfocussrc="pictures/detail/1x688.png"/>
	</a>
</xsl:when>
		  
		  
		  
		  
		  
          <xsl:when test="//movie/container = 'BDAV' and //movie/season = -1">
                <a class="link">
                  <xsl:attribute name="href">
                    <xsl:value-of select="concat(/details/movie/baseFilename,'.playlist.jsp')" />
                  </xsl:attribute>
				  			<xsl:attribute name="onkeydownset">pgdn</xsl:attribute>
							<xsl:attribute name="onkeyupset">pgup</xsl:attribute>
							<xsl:choose><xsl:when test="$WatchBar='true'">
							<xsl:attribute name="onkeyrightset">trailer</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:attribute name="onkeyrightset">pgdn</xsl:attribute>
							</xsl:otherwise></xsl:choose>
							<xsl:choose><xsl:when test="$extras='true'">
							<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:if test="$WatchBar='true'">
							<xsl:attribute name="onkeyleftset">trailer</xsl:attribute>
							</xsl:if>
							<xsl:if test="$WatchBar='false'">
							<xsl:attribute name="onkeyleftset">pgup</xsl:attribute>
							</xsl:if>
							</xsl:otherwise></xsl:choose>
                  <xsl:attribute name="TVID">Play</xsl:attribute>
                  <xsl:attribute name="name">play</xsl:attribute>

                  <xsl:attribute name="vod">playlist</xsl:attribute>
                  <img src="pictures/detail/1x688.png" onfocussrc="pictures/detail/1x688.png"/>
                </a>
				
						                        <xsl:for-each select="files/file">
                        <xsl:sort select="@firstPart" data-type="number" order="ascending"/>
<!--                        <xsl:if test="position() = 1">
                          <a id="playLink" tvid="Play" vod="playlist">
                            <xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          </a>
                        </xsl:if>-->
                        <a>
                          <xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          <xsl:attribute name="TVID"><xsl:value-of select="@firstPart"/></xsl:attribute>
                          <xsl:attribute name="name">e<xsl:value-of select="position()"/></xsl:attribute>
                          <xsl:attribute name="onkeyleftset">e<xsl:value-of select="position()-1"/></xsl:attribute>
                          <xsl:attribute name="onkeyrightset">e<xsl:value-of select="position()+1"/></xsl:attribute>
                          <xsl:attribute name="onfocus">show(<xsl:value-of select="@firstPart"/>)</xsl:attribute>
                          <xsl:attribute name="onblur">hide()</xsl:attribute>

                          <xsl:call-template name="zcd">
                            <xsl:with-param name="url" select="fileURL"/>
                            <xsl:with-param name="container" select="//movie/container"/>
                          </xsl:call-template>

                          <xsl:attribute name="vod"/>

                          <xsl:if test="//movie/prebuf != -1">
                            <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
                          </xsl:if>

<!--                          <xsl:if test="position() = 1">
                            <xsl:attribute name="name">Play</xsl:attribute>
                          </xsl:if>-->

<!--                          <img src="pictures/play_small.png" onfocussrc="pictures/play_selected_small.png" align="top">
                            <xsl:attribute name="onmouseover">show(<xsl:value-of select="@firstPart"/>);</xsl:attribute>
                            <xsl:attribute name="onmouseout">hide();</xsl:attribute>
                          </img>-->
                        </a>
                        <a class="link">
                          <xsl:if test="position() = 1"> 
                            <xsl:attribute name="class">firstMovie</xsl:attribute> 
                          </xsl:if>

<!--                          <xsl:value-of select="@firstPart"/>
                          <xsl:if test="@firstPart!=@lastPart">-<xsl:value-of select="@lastPart"/></xsl:if>
                          <xsl:text>&#160; </xsl:text>-->
                        </a>
                      </xsl:for-each>
				
          </xsl:when>


		  
		  
		  
		  
		  
		  
		  
          <xsl:otherwise>
<!--              <xsl:variable name="episodeSortOrder">
                <xsl:choose>
                  <xsl:when test="$skin-reverseEpisodeOrder='true' and //movie/season != -1">
                    <xsl:text>descending</xsl:text>
                  </xsl:when>
                  <xsl:otherwise>ascending</xsl:otherwise>
                </xsl:choose>
              </xsl:variable>-->
                  <xsl:if test="($skin-playAllMovie = 'top' and //movie/season = -1) or ($skin-playAllTV = 'top' and //movie/season != -1)">
<!--                        <div id="title">&#160; </div>-->
<!-- play all -->
                        <a class="link" tvid="Play">
							<xsl:attribute name="onkeydownset">pgdn</xsl:attribute>
							<xsl:attribute name="onkeyupset">pgup</xsl:attribute>
							<!--<xsl:attribute name="onkeyrightset">trailer</xsl:attribute>
							<xsl:choose><xsl:when test="$extras='true'">
							<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:attribute name="onkeyleftset">trailer</xsl:attribute>
							</xsl:otherwise></xsl:choose>-->
							
							<xsl:choose><xsl:when test="$WatchBar='true'">
							<xsl:attribute name="onkeyrightset">trailer</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:attribute name="onkeyrightset">pgdn</xsl:attribute>
							</xsl:otherwise></xsl:choose>
							<xsl:choose><xsl:when test="$extras='true'">
							<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
							</xsl:when><xsl:otherwise>
							<xsl:if test="$WatchBar='true'">
							<xsl:attribute name="onkeyleftset">trailer</xsl:attribute>
							</xsl:if>
							<xsl:if test="$WatchBar='false'">
							<xsl:attribute name="onkeyleftset">pgup</xsl:attribute>
							</xsl:if>
							</xsl:otherwise></xsl:choose>
							
							<xsl:attribute name="name">play</xsl:attribute>
                          <xsl:attribute name="onfocus">hide()</xsl:attribute>
						  
<xsl:choose>
<xsl:when test="//movie/container = 'ISO' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.ISO' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.iso'">
							<xsl:attribute name="zcd">2</xsl:attribute>
							<xsl:attribute name="vod"></xsl:attribute>
							<xsl:attribute name="href"><xsl:value-of select="//files/file/fileURL" /></xsl:attribute>
</xsl:when>

<xsl:when test="//movie/container = 'IMG' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.IMG' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.img'">
							<xsl:attribute name="zcd">2</xsl:attribute>
							<xsl:attribute name="vod"></xsl:attribute>
							<xsl:attribute name="href"><xsl:value-of select="//files/file/fileURL" /></xsl:attribute>
</xsl:when>
<xsl:when test="//movie/container = 'DVD Video' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-7,8) = 'VIDEO_TS' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-7,8) = 'video_ts'">
							<xsl:attribute name="zcd">2</xsl:attribute>
							<xsl:attribute name="vod"></xsl:attribute>
							<xsl:attribute name="href"><xsl:value-of select="//files/file/fileURL" /></xsl:attribute>
</xsl:when>
<xsl:otherwise>
                          <xsl:attribute name="href"><xsl:value-of select="concat(/details/movie/baseFilename,'.playlist.jsp')" /></xsl:attribute>
                          <xsl:attribute name="vod">playlist</xsl:attribute>
</xsl:otherwise>
</xsl:choose>

                          <xsl:if test="//movie/prebuf != -1">
                             <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
                          </xsl:if>
                          <img src="pictures/detail/1x688.png" onfocussrc="pictures/detail/1x688.png" align="top"/>
                        </a>
<!-- play all -->
                  </xsl:if>

                      <xsl:for-each select="files/file">
                        <xsl:sort select="@firstPart" data-type="number" order="ascending"/>
<!--                        <xsl:if test="position() = 1">
                          <a id="playLink" tvid="Play" vod="playlist">
                            <xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          </a>
                        </xsl:if>-->
                        <a>
                          <xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          <xsl:attribute name="TVID"><xsl:value-of select="@firstPart"/></xsl:attribute>
                          <xsl:attribute name="name">e<xsl:value-of select="position()"/></xsl:attribute>
                          <xsl:attribute name="onkeyleftset">e<xsl:value-of select="position()-1"/></xsl:attribute>
                          <xsl:attribute name="onkeyrightset">e<xsl:value-of select="position()+1"/></xsl:attribute>
                          <xsl:attribute name="onfocus">show(<xsl:value-of select="@firstPart"/>)</xsl:attribute>
                          <xsl:attribute name="onblur">hide()</xsl:attribute>

                          <xsl:call-template name="zcd">
                            <xsl:with-param name="url" select="fileURL"/>
                            <xsl:with-param name="container" select="//movie/container"/>
                          </xsl:call-template>

                          <xsl:attribute name="vod"/>

                          <xsl:if test="//movie/prebuf != -1">
                            <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
                          </xsl:if>

<!--                          <xsl:if test="position() = 1">
                            <xsl:attribute name="name">Play</xsl:attribute>
                          </xsl:if>-->

<!--                          <img src="pictures/play_small.png" onfocussrc="pictures/play_selected_small.png" align="top">
                            <xsl:attribute name="onmouseover">show(<xsl:value-of select="@firstPart"/>);</xsl:attribute>
                            <xsl:attribute name="onmouseout">hide();</xsl:attribute>
                          </img>-->
                        </a>
                        <a class="link">
                          <xsl:if test="position() = 1"> 
                            <xsl:attribute name="class">firstMovie</xsl:attribute> 
                          </xsl:if>

<!--                          <xsl:value-of select="@firstPart"/>
                          <xsl:if test="@firstPart!=@lastPart">-<xsl:value-of select="@lastPart"/></xsl:if>
                          <xsl:text>&#160; </xsl:text>-->
                        </a>
                      </xsl:for-each>

<!--              <xsl:if test="($skin-playAllMovie = 'bottom' and //movie/season = -1) or ($skin-playAllTV = 'bottom' and //movie/season != -1)">
                        <div id="title">&#160; </div>
                        <a class="link">
                          <xsl:attribute name="onfocus">hide()</xsl:attribute>
                          <xsl:attribute name="href"><xsl:value-of select="concat(/details/movie/baseFilename,'.playlist.jsp')" /></xsl:attribute>
                          <xsl:attribute name="vod">playlist</xsl:attribute>
                          <xsl:if test="//movie/prebuf != -1">
                             <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
                          </xsl:if>
                          <img src="pictures/detail/1x688.png" onfocussrc="pictures/detail/1x688.png" align="top"/>
                        </a>
                  </xsl:if>-->

          </xsl:otherwise>
        </xsl:choose>	
</xsl:template>

</xsl:stylesheet>